import { http } from './http'
import { order } from './url'

export function getOrderList(params: any, page: any) {
    const url = `${order.getOrderList}?pageIndex=${page.pageIndex}&pageSize=${page.pageSize}`
    return http.post<any>(url, params).then(res => {
        return {
            code: 200,
            data: res,
            msg: ''
        }
    })
}
export function approveOrder(params: any) {
    const url = `${order.approveOrder}`
    return http.post<any>(url, params).then(res => {
        return {
            code: 200,
            data: res,
            msg: ''
        }
    })
}
export function downloadOrder(params: any) {
    const url = `${order.downloadOrder}`
    return http.post<any>(url, {
        orderCode: params.orderCode
    }, {
        responseType: 'blob'
    }).then(res => {
        return {
            code: 200,
            data: res,
            msg: ''
        }
    })
}